#ifndef MYPLAYERACTIONMANAGER_H
#define MYPLAYERACTIONMANAGER_H

#include "MyDefinitions.h"

class MyGame;

#define ACTION_ARRAY_SIZE ST_SHOT_COUNT+ST_SPELL_COUNT

/*! 
 *  \struct actionType
 *  \brief info about all types of actions - weapon and spell
 *  \author Peter Kosa
 *  \version 1.52
 *  \date    2006-2008
 */
struct actionType {
	int icon_sheet_pos, dice_times, dice_size, dice_add;
	bool spell, enabled;
	actionType(){}
	/*! add action of type _spell (!_spell = weapon), which is _enabled for player to use, does damage of <_dt>D<_ds> + <_da> and resides on _icon_sheet_pos in the sprite sheet */
	actionType(int _icon_sheet_pos, int _dt, int _ds, int _da,bool _spell, bool _enabled)
		:icon_sheet_pos(_icon_sheet_pos),dice_times(_dt), dice_size(_ds), dice_add(_da), enabled(_enabled), spell(_spell){}
};
/*! 
 *  \struct MyPlayerActionManager
 *  \brief class handling actual data about player weapons and spells
 *  \author Peter Kosa
 *  \version 1.52
 *  \date    2006-2008
 */
class MyPlayerActionManager
{
public:
	MyPlayerActionManager(MyGame* _this);
	~MyPlayerActionManager();
	/*! initialize all */
	void init();	
	/*! cycle through player's spells */
	void setNextSpell();
	/*! cycle through player's weapons */
	void setNextShot();
	/*! get rect of item in the sheet */
	SDL_Rect* getActionRect(int _pos); 
	/*! get rect of actual spell in the sheet */
	SDL_Rect* getActSpellRect();
	/*! get rect of actual weapon in the sheet */
	SDL_Rect* getActShotRect();
  /*! get dmg done by this spell */  
	int getActSpellDmg();
	/*! get dmg done by this weapon */
	int getActShotDmg();
  /*! enable the item on _pos */
	bool enableItem(int _pos); 
	/*! returns actual spell pos */
	int getActSpellPos();
	/*! returns actual weapon pos */
	int getActShotPos();
	/*! returns true if the item on pos is enabled */
	bool is_enabled(int pos);

	//pointer to parent
	MyGame* parent;
	/*! sheet for action images */
	SDL_Surface *actionImgSheet;	
private:
	/*! array of all possible actions */
	actionType * action_array[ACTION_ARRAY_SIZE];
	int actSpellPos, actShotPos;
};
#endif
